using System.Collections.Generic;
using System.Windows.Forms;
using Belmost4PDA.Constants;
using Belmost4PDA.Fasade;

namespace Belmost4PDA.Fasade
{
    public abstract class AbstractControl
    {
        
        /// <summary>
        /// Gets the type of the control.
        /// </summary>
        /// <returns></returns>
        public abstract string GetControlType();
        //public abstract List<GridItem> GetGrid();
        public List<AbstractControl> ChildControls = new List<AbstractControl>();

        public virtual bool Editable()
        {
            return false;
        }
        /// <summary>
        /// Adds the child.
        /// </summary>
        /// <param name="control">The control.</param>
        public void AddChild(AbstractControl control)
        {
            if(!ChildControls.Contains(control))
                ChildControls.Add(control);
        }
        /// <summary>
        /// Gets the grid.
        /// </summary>
        /// <returns></returns>
        public virtual AbstractControl GetGrid()
        {
            return null;
        }


        /// <summary>
        /// Gets the controls of panel.
        /// </summary>
        /// <param name="controlsList">The controls list.</param>
        /// <param name="IdPanel">The id panel.</param>
        public virtual void GetControlsOfPanel(List<AbstractControl> controlsList, int IdPanel)
        {
            // do nothing
        }
        /// <summary>
        /// Gets the mapper.
        /// </summary>
        /// <returns></returns>
        public abstract AbstractMapper GetMapper();

        /// <summary>
        /// Gets the form control.
        /// </summary>
        /// <returns></returns>
        public abstract Control GetFormControl();

        /// <summary>
        /// Gets the caption. "" - means NO CAPTION (for Button for example)
        /// </summary>
        /// <returns></returns>
        public abstract string GetCaption();
    }
}